package com.bjpowernode.controllers;

import com.bjpowernode.querys.TranHistoryQuery;
import com.bjpowernode.result.Result;
import com.bjpowernode.services.TranHistoryService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TranHistoryController {
    @Resource
    private TranHistoryService tranHistoryService;

    @PostMapping(value = "/api/tran/stage")
    public Result addTranHistory(@RequestBody TranHistoryQuery tranHistoryQuery) {
        boolean flag = tranHistoryService.addTranHistory(tranHistoryQuery);
        return flag ? Result.OK() : Result.FAIL();
    }
}
